﻿<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="__STATIC__/admin/lib/html5shiv.js"></script>
    <script type="text/javascript" src="__STATIC__/admin/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="__STATIC__/admin/static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/admin/static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/admin/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/admin/static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/admin/static/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/admin/static/h-ui.admin/css/page.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="__STATIC__/admin/lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>评论列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 评论管理 <span
        class="c-gray en">&gt;</span> 评论列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                                               href="javascript:location.replace(location.href);" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="row cl mb-20">
        <div class="col-xs-6 text-l">
            <!--<a href="javascript:;" onclick="commentAdd()" class="btn btn-primary radius">-->
                <!--<i class="Hui-iconfont">&#xe600;</i> 添加评论</a>-->
        </div>
        <div class="col-xs-6 text-r">
            <form id="form1" action="{:url('comment/index')}" method="get">
                <select class="select" size="1" name="type" style="width: 100px;height: 31px;position: relative;top:2px">
                  <option value="0" selected>按评论内容</option>
                  <option value="1">按文章标题</option>
                </select>
                <input type="text" class="input-text" style="width: 250px"  placeholder="输入关键字..." id="keyword" name="keyword" value="{$keyword}">
                <button type="submit" class="btn btn-success" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
            </form>
        </div>
    </div>
    <table class="table table-border table-bordered table-bg">
        <thead>
        <tr class="text-c">
            <th width="30">ID</th>
            <th width="100">评论内容</th>
            <th width="100">评论人</th>
            <th width="100">回复内容</th>
            <th width="100">回复人</th>
            <th width="100">文章标题</th>
            <th width="50">是否屏蔽</th>
            <th width="50">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr class="text-c">
            <td>{$vo.comment_id}</td>
            <td><a title="{$vo.comment}" href="javascript:;" onclick="showMore(this)">{$vo.comment_new}</a></td>
            <td>{$vo.comment_user}</td>
            <td><a title="{$vo.reply}" href="javascript:;" onclick="showMore(this)">{$vo.reply_new}</a></td>
            <td>{$vo.reply_user}</td>
            <td>{$vo.art_title}</td>
            <td>{$vo.is_show}</td>
            <td class="td-comment">
                <a title="编辑" href="javascript:;" onclick="shield({$vo.comment_id})" class="ml-5"
                   style="text-decoration:none;color:green">屏蔽</a>
                <a title="编辑" href="javascript:;" onclick="del({$vo.comment_id})" class="ml-5"
                   style="text-decoration:none;color:red">删除</a>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page text-l">{$page}</div>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__STATIC__/admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__STATIC__/admin/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__STATIC__/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
    /*显示-更多*/
    function showMore(that) {
        var temp = $(that).attr("title");
        layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['420px', '240px'], //宽高
            content: '<div style="padding:10px">'+temp+'</div>'
        });
    }

    /*评论-屏蔽*/
    function shield(comment_id) {
        layer.confirm('确认要屏蔽吗？', function (index) {
            $.ajax({
                type: 'POST',
                url: '{:url("comment/shield")}',
                data: {
                    comment_id: comment_id
                },
                dataType: 'json',
                success: function (res) {
                    if (res.code == 1) {
                        layer.alert(res.message);
                    }
                    if (res.code == 0) {
                        location.reload();//刷新
                    }
                },
                error: function () {
                    console.log("异常");
                }
            });
        });
    }

    /*评论-删除*/
    function del(comment_id) {
        layer.confirm('确认要删除吗？', function (index) {
            $.ajax({
                type: 'POST',
                url: '{:url("comment/del")}',
                data: {
                    comment_id: comment_id
                },
                dataType: 'json',
                success: function (res) {
                    if (res.code == 1) {
                        layer.alert(res.message);
                    }
                    if (res.code == 0) {
                        location.reload();//刷新
                    }
                },
                error: function () {
                    console.log("异常");
                }
            });
        });
    }
</script>
</body>
</html>